package org.springframework.beanFactory.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * @Author: T-jack
 * @Date: 2024-01-03-11:05
 * @Description:
 */
@Component
@Slf4j
public class UserService {
	@Autowired
	private ApplicationEventPublisher context;
	public void register(String username, String password) {
		log.debug("新用户注册，账号：" + username + "，密码：" + password);
		context.publishEvent(new UserRegisteredEvent(this));
	}
}
